package com.cqw.es.controller;

import com.cqw.common.BaseResponse;
import com.cqw.es.domain.EsEntity;
import com.cqw.es.service.EsService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-07-20 14:58
 * @Description:
 */
@RestController
@RequestMapping("/es")
@Slf4j
@Api(tags = "ES")
public class EsController {


    @Resource
    private EsService esService;


    @GetMapping("/init")
    public BaseResponse getList() {
        List<EsEntity> query = esService.query();
        return BaseResponse.success(query);
    }


}
